import { defineEventHandler, getRouterParam } from 'h3';

export default defineEventHandler(async (event) => {
  const deployId = getRouterParam(event, 'deployId');

  // 模拟部署状态数据
  const deployStatus = {
    id: deployId,
    applicationId: '1',
    status: 'running',
    currentStep: 3,
    totalSteps: 5,
    progress: 60,
    startTime: new Date(Date.now() - 300000).toISOString(), // 5分钟前开始
    endTime: null,
    error: null,
  };

  return {
    code: 0,
    data: deployStatus,
    msg: '获取部署状态成功',
  };
});
